
pkgname=nano
pkgver=2.9.8
_pkgver=2.9
pkgrel=1
pkgdesc="Pico editor clone with enhancements"
arch=('x86_64')
license=('GPL')
url="https://www.nano-editor.org"
groups=('base')
depends=('glibc' 'ncurses' 'sh')
makedepends=('groff')
source=("https://www.nano-editor.org/dist/v${_pkgver}/nano-${pkgver}.tar.xz")
backup=(etc/nanorc)
md5sums=('31714360342f9baa344e2fa574c144db')

build() {
  cd ${pkgname}-${pkgver}
  
  ./configure --prefix=/usr \
        --sysconfdir=/etc \
        --enable-color \
        --enable-nanorc \
        --enable-multibuffer \
        --disable-wrapping-as-root
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  
  install -DTm644 ${srcdir}/${pkgname}-${pkgver}/doc/sample.nanorc ${pkgdir}/etc/nanorc
}
